<template>
	<view class="tabber">
		<view class="tab" 
		v-for="(item,index) in tabberList" 
		:key="index" @tap="navigatorTo(item.pagePath)">
			<image v-if="item.pagePath===currentPage" :src="item.selectedIconPath" mode=""></image>
			<image v-else :src="item.iconPath" mode=""></image>
			<view class="text">{{item.text}}</view>
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default{
		props:{
			currentPage:{
				type:String,
				default:'index'
			}
		},
		computed:{
			
		},
		data(){
			return{
				tabberList:[
					{
					    "pagePath": "statistics",
					    "iconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/statistics_gray.png",
					    "selectedIconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/statistics.png",
					    "text": "平台统计"
					},
					{
						"pagePath": "review",
						// 
						"iconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/manage_gray.png",
						"selectedIconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/manage.png",
						"text": "审核管理"
					},
					{
						"pagePath": "withdrawal",
						"iconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/check_gray.png",
						"selectedIconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/check.png",
						"text": "审核提现"
					},
					{
						"pagePath": "recharge-records",
						"iconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/recharge-gray.png",
						"selectedIconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/recharge-center.png",
						"text": "充值记录"
					},
					{
					    "pagePath": "withdrawalRecords",
					    "iconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/withdraw-gray.png",
					    "selectedIconPath": "https://huishou.68699.cn/addons/wjyk_recycle/public/static/index/withdraw-center.png",
					    "text": "提现记录"
					}
				]
			}
		},
		methods:{
			navigatorTo(e){
				//uni.redirectTo:关闭当前页面跳转
				uni.redirectTo({
					url:`../${e}/${e}`
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.tabber{
		background-color: #fff;
		z-index: 9999;
		border-bottom: 2rpx solid #636263;
		position: fixed;
		left:0;
		bottom: 0;
		width: 100%;
		height: 120rpx;
		display: flex;
		justify-content: space-around;
		align-items: center;
		.tab{
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			image{
				width: 50rpx;
				height: 50rpx;
			}
			.text{
				padding: 5rpx 0;
				font-size: 24rpx;
			}
		}
	}
</style>